var globalThis = this, self = this;
module.exports =
require("../../_commons/0.js")([
{
"ids": [22],
"modules":{

/***/ "./node_modules/@mpflow/webpack-plugin/lib/loaders/page-loader.js?appContext=src&outputPath=components%2Ftoptips%2Ftoptips!./src/components/toptips/toptips.ts":
/*!*********************************************************************************************************************************************************************!*\
  !*** ./node_modules/@mpflow/webpack-plugin/lib/loaders/page-loader.js?appContext=src&outputPath=components%2Ftoptips%2Ftoptips!./src/components/toptips/toptips.ts ***!
  \*********************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! ./toptips.ts */ "./src/components/toptips/toptips.ts")

/***/ }),

/***/ "./src/components/toptips/toptips.ts":
/*!*******************************************!*\
  !*** ./src/components/toptips/toptips.ts ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

Component({
  options: {
    addGlobalClass: true
  },
  properties: {
    type: {
      type: String,
      value: 'error',
      observer: '_typeChange'
    },
    show: {
      type: Boolean,
      value: false,
      observer: '_showChange'
    },
    msg: {
      type: String,
      value: ''
    },
    delay: {
      type: Number,
      value: 2000
    },
    extClass: {
      type: String,
      value: ''
    }
  },
  data: {
    typeClassMap: {
      warn: 'weui-toptips_warn',
      info: 'weui-toptips_info',
      success: 'weui-toptips_success',
      error: 'weui-toptips_error'
    }
  },
  attached: function attached() {
    var data = this.data;
    this.setData({
      className: data.typeClassMap[data.type] || ''
    });
  },
  methods: {
    _typeChange: function _typeChange(newVal) {
      this.setData({
        className: this.data.typeClassMap[newVal] || ''
      });
      return newVal;
    },
    _showChange: function _showChange(newVal) {
      this._showToptips(newVal);
    },
    _showToptips: function _showToptips(newVal) {
      var _this = this;

      if (newVal && this.data.delay) {
        setTimeout(function () {
          _this.setData({
            show: false
          }, function () {
            // tooltips 隐藏了，触发 hide 事件
            _this.triggerEvent('hide', {}, {});
          });
        }, this.data.delay);
      }

      this.setData({
        show: newVal
      });
    }
  }
});

/***/ })

},
"entries": [["./node_modules/@mpflow/webpack-plugin/lib/loaders/page-loader.js?appContext=src&outputPath=components%2Ftoptips%2Ftoptips!./src/components/toptips/toptips.ts",0]]
},
]);

// # sourceMappingURL=toptips.js.map